<template>
	<view>
		<dateSelector defaultDateType="month" :dateTypes="['day', 'week', 'month', 'year', 'total']" @change="onDateChange"></dateSelector>
		<view class="content">
			<view v-for="(item,index) in Object.keys(selectedDate)" :key="index">
				{{item}}: {{selectedDate[item]}}
			</view>
		</view>
	</view>
</template>

<script>
	import {dateSelector, datePickerHelper} from '../../components/date-selector/index.js'
	export default {
		components:{
			dateSelector
		},
		data() {
			return {
				selectedDate: datePickerHelper.getTheDateValue('month')
			}
		},
		onLoad() {

		},
		methods: {
			onDateChange(val){
				console.log('onDateChange', JSON.stringify(val))
				this.selectedDate = val
			}
		}
	}
</script>

<style>

</style>
